package com.weijianhuawen.wjblog.web.mode;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * @version: java version 8
 * @Author: weijianhuawen
 * @description: 用户类
 * @date: 2024-10-15 1:16
 */
@Data
@ApiModel("用户实体")
public class User {
    //用户名
    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty("用户名")
    private String userName;
    //密码
    @NotBlank(message = "密码不能为空")
    @ApiModelProperty("密码")
    private String password;
    // sex
    @NotNull(message = "性别不能为空")
    @ApiModelProperty("性别")
    private Integer sex;
    //年龄
    @NotNull(message = "年龄不能为空")
    @Min(value = 12, message = "最小年龄不得小于12岁")
    @Max(value = 200, message = "最大年龄不得大于200岁")
    @ApiModelProperty("年龄")
    private Integer age;
    //邮箱
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式有误")
    @ApiModelProperty("邮箱")
    private String email;

    // 创建时间
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;
    // 更新日期
    @ApiModelProperty("更新日期")
    private LocalDate updateDate;
    // 时间
    @ApiModelProperty("时间")
    private LocalTime time;

}
